import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

// 导入组件文件 通过懒加载模式
const Home = () => import('views/home/Home')
const Cart = () => import('views/cart/Cart')
const Category = () => import('views/category/Category')
const Profile = () => import('views/profile/Profile')
const routes = [
  {
    path: '',
    redirect:'/cart'
    // name: 'HelloWorld',    
  },
  {
    path:'/cart',
    component:Cart
  },
  {
    path:'/category',
    component:Category
  },
  {
    path:'/profile',
    component:Profile
  },
  {
    path:'/home',
    component:Home
  }
]
export default new Router({
  routes,
  mode:'history'
})
